( ()=>{
    const btn = document.querySelector( '#parse' );

    let handler = {
        handleEvent(e){
            let $http = e.target ;
            if( $http.readyState === $http.DONE ) {
                let headers = $http.getAllResponseHeaders();
                console.log( headers );
                let etag = $http.getResponseHeader( 'etag' );
                console.log( etag );
            }
        }
    }

    let listener = {
        handleEvent(){
            let $http = new XMLHttpRequest();
            $http.addEventListener( 'readystatechange' , handler , false ) ;
            $http.open( 'get' , '/parse' );
            $http.send();
        }
    }

    btn.addEventListener( 'click' , listener , false );
} )();